﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ChooseMemorizedTransaction.aspx.cs" Inherits="Admin_ChooseMemorizedTransaction" %>
<%@ Import Namespace="Money.Data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="scriptCssContent" Runat="Server">
    <link href="../css/tables.css" type="text/css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="titlePlaceHolder" Runat="Server">
    <asp:literal id="pageTitle" runat="server"></asp:literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="menuPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
    <one:repeater id="repeaterTransactions" runat="server">
        <headertemplate>
            <table class="Grid">
                <thead>
                    <tr>
                        <th></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Id.ToString()) %>"><%= Resources.Strings.TransactionId %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Id.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.TransactionType.ToString()) %>"><%= Resources.Strings.TransactionType %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.TransactionType.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Account.ToString()) %>"><%= Resources.Strings.Account %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Account.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Category.ToString()) %>"><%= Resources.Strings.Category %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Category.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Ref.ToString()) %>"><%= Resources.Strings.Ref %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Ref.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Class.ToString()) %>"><%= Resources.Strings.Class %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Class.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.PayMan.ToString()) %>"><%= Resources.Strings.PayMan %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.PayMan.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.Amount.ToString()) %>"><%= Resources.Strings.Amount %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.Amount.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(MemorizedTransactionOrderBy.CreationOn.ToString()) %>"><%= Resources.Strings.CreationOn %></a><%= GetOrderDirectionIndicator(MemorizedTransactionOrderBy.CreationOn.ToString())%></th>
                    </tr>
                </thead>
                <tbody>
        </headertemplate>
        <itemtemplate>
                    <tr>
                        <td class="Check"><input type="radio" name="selectedItem" value="<%# Eval(MemorizedTransactionOrderBy.Id.ToString()) %>" <%# ((Container.ItemIndex == 0) ? "checked" : "") %> /></td>
                        <td class="Number"><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Id.ToString()))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(GetNameTransactionType(Eval(MemorizedTransactionOrderBy.TransactionType.ToString())))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Account.ToString() + ".DisplayName"))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Category.ToString() + ".Name"))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Ref.ToString() + ".Name"))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Class.ToString() + ".Name"))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.PayMan.ToString()))%></td>
                        <td class="Number"><%# One.Web.HttpUtility.HtmlEncode(Eval(MemorizedTransactionOrderBy.Amount.ToString()))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(((DateTime)Eval(MemorizedTransactionOrderBy.CreationOn.ToString())).ToString(MoneyManagerConfig.DateTimeFormat))%></td>
                    </tr>
        </itemtemplate>
        <nonetemplate>
                    <tr>
                        <td colspan="10"><%= Resources.Strings.NoItem %></td>
                    </tr>
        </nonetemplate>
        <footertemplate>
                </tbody>
            </table>
        </footertemplate>
    </one:repeater>
    <div class="Pagination">
        <one:pager id="pager" runat="server" parameter="Page" pagesize="5"></one:pager> 
    </div>
    <div class="ActionRow">
        <asp:button runat="server" id="deleteButton" text="<%$ Resources:Strings,Choose %>" onclick="SelectMemorizedTransaction" />      
        <input type="button" value="<%= Resources.Strings.Cancel %>" onclick="window.location = 'TransactionManagement.aspx';" />
    </div>
    <script language="javascript" type="text/javascript">
        choiceBehavior.totalItems = <%= listMemorizedTransactions == null ? 0 : listMemorizedTransactions.Count%>;
        choiceBehavior.btnActions = new Array();
        choiceBehavior.btnActions[0] = getControl('<%= deleteButton.ClientID%>');
        choiceBehavior.checkAll = getControl('checkAll');
        choiceBehavior.init();
    </script>    
</asp:Content>

